// 统一管理用户相关的接口
import { defaultRequest } from '@/utils/request'
// 同意管理用的的接口
enum API {
     GetType = '/api/LwHazards/GetType',
     GetHazardPc = '/api/LwHazards/GetHazardPc',
     UpdateHazardBatch = '/api/LwHazards/UpdateHazardBatch',
     ExportTemplateData = '/api/LwHazards/ExportTemplateData',
     UpdateHazard = '/api/LwHazards/UpdateHazard',
     HazardXiaohao = '/api/LwHazards/HazardXiaohao',
     SaveAllHazardData = '/api/LwHazards/SaveAllHazardData',
     CreateHazard = '/api/LwHazards/CreateHazard',
}
// 对外暴漏请求函数
export const GetType = () => defaultRequest.get(API.GetType)
export const GetHazardPc = (data: any) => defaultRequest.post(API.GetHazardPc, data)
export const GetHazardPcExport = (data: any) => defaultRequest.post(API.GetHazardPc, data, { responseType: 'blob' })
export const UpdateHazardBatch = (data: any) => defaultRequest.post(API.UpdateHazardBatch, data)
export const UpdateHazardFile = (data: any, file: any) => defaultRequest.upload({ url: API.HazardXiaohao, data }, file, true)
export const UpdateHazard = (data: any, file: any = []) => defaultRequest.upload({ url: API.UpdateHazard, data }, file)
export const SaveAllHazardData = (data: any, file: any) => defaultRequest.upload({ url: API.SaveAllHazardData, data }, file, true)
export const ExportTemplateData = () => defaultRequest.get(API.ExportTemplateData, { responseType: 'blob' })
export const CreateHazard = (data: any) => defaultRequest.post(API.CreateHazard, data)
